home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 003 / fdm.lbr / fdm.doc < prev   
Text File  |  2011-01-29  |  5KB  |  118 lines

  1.                      Documentation for use with FDM             Page 1 of 1
  2.                          File Drawer Manager
  3.  
  4.  
  5.      FDM is a keyed file maintenance system.  It manages ASCII files in key
  6. order.  Each data file that FDM manages has a .DAT suffix on it.  Two
  7. supporting files with the same name but different suffixes are created for
  8. use in managing the data file.  One is the index file, with suffix .NDX, and
  9. the other is the format file, with suffix .FMT.  The format file contains
  10. information about the fields and the screen layout.  It is created only once,
  11. the first time the data file is created.
  12.      To get into the File Drawer Manager, type FDM from the DOS prompt.
  13. Optionally, the file name you wish to manage can be placed on this line.
  14. Examples:  >FDM
  15.            >FDM Myfile
  16.            >FDM B:Myfile
  17.  
  18.      If the file is new, you will have to answer 'Y' to the 'New File?' prompt.
  19. Then you will need to define the file.  First type in the name of the screen.
  20. This title will appear on all online screens while dealing with this file.
  21. Then hit Return.  Now enter all screen prompts for up to 20 fields which will
  22. be collected in your file.  Hit Return when all fields have been entered.
  23. Remember that the first data field is going to be your key field.
  24. Now enter the data length for each of the fields entered.  If all is okay,
  25. hit Return.  Otherwise, hit ESC, then Return.  You will then be allowed to
  26. redo any of it.
  27.      Once the file is defined, you will be put into browse mode.  Of course,
  28. if your file is new, you will need to get into Add mode.  Modes can be
  29. switched whenever you are being prompted for a new key.  If you are in Add
  30. or Update mode, and you wish to cancel out of the transaction, hit ESC followed
  31. by Return.  Deletes will be verified with a 'Y' or 'N'.
  32.  
  33.      The following editing keys can be used with FDM:
  34.  
  35.           Ctrl-A  - Go into Add mode
  36.           Ctrl-B  - Go into Browse mode
  37.           Ctrl-D  - Go into Delete mode
  38.           Ctrl-N  - Get the next record in key sequence
  39.           Ctrl-P  - Get the previous record in key sequence
  40.           Ctrl-Q  - Leave FDM
  41.           Ctrl-S  - Toggle the Save On/Off toggle.  This is used when
  42.                     adding records.  Save On initializes a new record to an
  43.                     image of the last record reviewed.  This saves typing
  44.                     in some cases.  Save Off initializes a new record to
  45.                     spaces.
  46.           Ctrl-U  - Go into Update mode
  47.           Home    - Go to the beginning of a field
  48.           End     - Go to the end of a field
  49.           Ins     - Toggle Insert mode on or off.  This allows characters to
  50.                     be inserted in between two characters.
  51.           Del     - Deletes the character under the cursor and moves all
  52.                     characters to the right of the cursor left one space.
  53.          Left Tab - Moves the cursor left one character and erases as it goes.
  54.         Right Tab - Moves the cursor to the next field.
  55.       Right Arrow - Moves the cursor right one character.
  56.        Left Arrow - Moves the cursor left one character.
  57.        Down Arrow - Moves the cursor to the next field down.
  58.          Up Arrow - Moves the cursor to the previous field.
  59.          Ctrl-End - Erases the field from the cursor to the end of the field.
  60.  Ctrl-Right Arrow - Moves the cursor right 5 characters.
  61.   Ctrl-Left Arrow - Moves the cursor left 5 characters.
  62.  
  63.  
  64.  
  65.  
  66.  
  67.                      Documentation for use with FDM             Page 2 of 2
  68.                          File Drawer Manager
  69.  
  70.  
  71.      The files created by FDM are ASCII files which can be read by programs
  72. written in BASIC or PASCAL.  Each data record is has a two byte status code
  73. in the beginning which is used by the index routine.  This is '00' for a
  74. valid record.  Otherwise, you want to ignore it.  Also, the very first
  75. record of the data file is a control record and should be ignored.  The
  76. record length is 2 plus the length of all fields you requested.  An example
  77. BASIC program follows to read a data file consisting of name and occupation,
  78. where name can be 30 characters and occupation 20 characters:
  79.  
  80.    10 OPEN "B:EMPLOYEE.DAT" AS #1 LEN=52
  81.    20 FIELD 1, 2 AS STATUS$, 30 AS NME$, 20 AS OCCUP$
  82.    30 GET 1   ' Skip past first record
  83.    40 IF EOF(1) THEN GOTO 99
  84.    50 GET 1
  85.    60 IF STATUS$ = "00" THEN PRINT NME$, OCCUP$
  86.    70 GOTO 40
  87.    99 CLOSE:END
  88.  
  89. An example PASCAL program using the same example looks like this:
  90.  
  91.    Program Readit;
  92.  
  93.    Type
  94.     Rec =
  95.      Record
  96.       Status : Array[1..2] of Char;
  97.       Name   : Array[1..30] of Char;
  98.       Occupation : Array[1..20] of Char;
  99.      End;
  100.  
  101.    Var
  102.     DataRec : Rec;
  103.     DataFile : File of Rec;
  104.  
  105.    Begin {Readit}
  106.     Assign (DataFile, 'B:Employee.Dat');
  107.     Reset(DataFile);
  108.     While Not Eof(DataFile) Do
  109.      With DataRec Do
  110.       Begin
  111.        Read(DataFile,DataRec);
  112.        If Status = '00' Then
  113.         Writeln (Name, ' - ', Occupation);
  114.       End;
  115.     Close(DataFile);
  116.    End.
  117.  
  118.